package com.xoa.dao.workflow;

import com.xoa.model.workflow.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface FlowRunMapper {
    int deleteByPrimaryKey(Integer rid);

    int insert(FlowRun record);

    int insertSelective(FlowRun record);

    FlowRun selectByPrimaryKey(Integer rid);

    int updateByPrimaryKeySelective(FlowRun record);

    int updateByPrimaryKeyWithBLOBs(FlowRun record);

    int updateByPrimaryKey(FlowRun record);
    
    String getMaxRunId();

    FlowRun find(Integer runId);

    int updateTime(Map<String,Object> map);

    int updateAttachment(Map<String,Object> map);

    int cancelRun(Map<String,Object> map);

    List<Integer> getRunIdsByFlowId(Integer flowId);

    int deleteByFlowId(Integer flowId);

    List<FlowRunModelPrcs> queryFlowRun(Map<String,Object> map);

    List<FlowRun> sAll();

    List<FlowRunModelPrcs> queryFlowRunBycy(Map<String,Object> map);

    List<FlowRunModelPrcs> queryFlowRunBylimit(Map<String,Object> map);

    int updateFocusUser(Map<String,Object> map);

    Integer queryFlowRunCount(Map<String,Object> map);

    int updateWorkLevel(Map<String,Object> map);

    int updateEnd(Map<String,Object> map);

    int upRunByFouAndTime(FlowRun flowRun);
    FlowRunModelPrcsCount queryFlowRunPerformCount(Map<String,Object> map);
    FlowRunModelPrcsCount queryFlowRunEndCount(Map<String,Object> map);
    FlowRunModelPrcsCount queryFlowRunArchiveCount(Map<String,Object> map);

    List<FlowRunLog> selFlowRunLog(Map map);

    FlowRun selectByRunId(int runId);

    int delFlowRunLog(Integer logId);

    int updateParentRUN(FlowRun flowRun);

    List<FlowRun> findFlowRunIsRead(Map<String,Object> map);

    //查找当前流程的子流程
    List<FlowRun> getSonFlowRunWork(Map<String,Object> maps);

    List<FlowRun> selectFlow(Map map);

    List<FlowRun> selectFlowBy(Map map);

    List<FlowRun> selectFromParentId(@Param("runId") String runId);
    //获取常用公文流程
    List<Integer> sortFlowId (String[] flowIds);
}